package com.android.examplelist;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class ThemeActivity extends Activity {

	private static int mTheme = 0;  
	
	 public static final String ACTION_INTENT_TEST = "com.terry.broadcast.test";
	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		if (mTheme == 0) {
			setTheme(R.style.Theme_Day);
		} else {
			setTheme(R.style.Theme_Night);
		}
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.theme);

	}
	
	public void changeTheme(View tab) {
		
        Intent intent = new Intent(BroadcastType.BROADCAST_TEST);
        sendBroadcast(intent);
		
		System.out.println("++++++++++++++++++changeTheme");
		
		mTheme = (mTheme + 1) % 2;
		
		
		finish();
		startActivity(new Intent(this, this.getClass()));
		
	}

}
